package com.koala.learn.json;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * @author yantingrui
 * @date 2022/7/18   10:06
 */
@Data
public class Pois {

    private String name;
    private String title;
    private String address;
    private String location;
    @JsonProperty("business")
    private Business business;
    //@JsonProperty("business.tel")
    private String tel;
    private Double lat;
    private Double lng;


    public String getTitle() {
        return name;
    }

    public Double getLng() {
        if (location != null) {
            return Double.parseDouble(location.split(",")[0]);
        }
        return 0D;
    }

    public Double getLat() {
        if (location != null) {
            return Double.parseDouble(location.split(",")[1]);
        }
        return 0D;
    }
}
